home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / langs / iconv8_l.arc / IDOL.ARC / MSDOS.ICN < prev    next >
Encoding:
Text File  |  1990-03-19  |  2.0 KB  |  81 lines

  1. #
  2. # @(#)msdos.icn    1.3 3/13/90
  3. # OS-specific code for MS-DOS Idol
  4. #
  5. # For systems which cannot run icont from within an Icon program,
  6. # the approach is for Idol to generate a script/batch file to do this.
  7. #
  8. global lnkopt,cd,md,env,sysok,batfile
  9.  
  10. procedure mysystem(s)
  11.   if /batfile then batfile := open("idolt.bat","w")
  12.   if \loud then write(s)
  13.   write(batfile,s)
  14.   return sysok # system(s) # MS-DOS Icon is generally too big to use system()
  15. end
  16.  
  17. procedure filename(s)
  18.   s[9:0] := ""
  19.   return s
  20. end
  21. procedure writesublink(s)
  22.   writelink(env||"\\\\"||s)
  23. end
  24. procedure envpath(filename)
  25.   return env||"\\"||filename
  26. end
  27. #
  28. # Installation.
  29. # Uses hierarchical filesystem on some systems (see initialize)
  30. #
  31. procedure install(args)
  32.   write("Installing idol environment in ",env)
  33.   if env ~== "" then mysystem(md||env)
  34.   if fout := envopen("i_object.icn","w") then {
  35.     write(fout,"record idol_object(__state,__methods)")
  36.     close(fout)
  37.   } else {
  38.     if not (fout := open("i_object.icn","w")) then stop("can't open i_object")
  39.     write(fout,"record idol_object(__state,__methods)")
  40.     close(fout)
  41.     mysystem("copy i_object.icn "||env)
  42.     mysystem("del i_object.icn")
  43.   }
  44.   fout := &null
  45.   cdicont(["i_object"])
  46. end
  47.  
  48. procedure makeexe(args,i)
  49.   exe := args[i]
  50.   if icont(lnkopt||exe) = \sysok then {
  51.       if \exec then {
  52.     write("Executing:")
  53.     exe := "iconx "||exe
  54.     every i := exec+1 to *args do exe ||:= " "||args[i]
  55.     mysystem(exe)
  56.       }
  57.   }
  58. end
  59. #
  60. # system-dependent compilation of idolfile.icn
  61. #   (in the idol subdirectory, if there is one)
  62. #
  63. procedure cdicont(idolfiles)
  64.   if comp = -2 then return  # -t --> don't call icont at all
  65.   args := " -c"
  66.   rms  := ""
  67.   every ifile := !idolfiles do args ||:= " " || ifile
  68.   every ifile := !idolfiles do rms  ||:= " " || ifile || ".icn"
  69.  
  70.   mysystem("cd idolcode.env")
  71.   icont(args)
  72.   mysystem("cd ..")
  73. end
  74. procedure sysinitialize()
  75.   lnkopt := " -Sr500 -SF30 -Si1000 "
  76.   cd := "cd "
  77.   md := "mkdir "
  78.   env := "idolcode.env"
  79.   sysok := 0
  80. end
  81.